package bc

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type BcRecordRouter struct {
}

// InitBcRecordRouter 初始化 bcRecord表 路由信息
func (s *BcRecordRouter) InitBcRecordRouter(Router *gin.RouterGroup) {
	bcRecordRouter := Router.Group("bcRecord").Use(middleware.OperationRecord())
	bcRecordRouterWithoutRecord := Router.Group("bcRecord")
	var bcRecordApi = v1.ApiGroupApp.BcApiGroup.BcRecordApi
	{
		bcRecordRouter.POST("createBcRecord", bcRecordApi.CreateBcRecord)             // 新建bcRecord表
		bcRecordRouter.DELETE("deleteBcRecord", bcRecordApi.DeleteBcRecord)           // 删除bcRecord表
		bcRecordRouter.DELETE("deleteBcRecordByIds", bcRecordApi.DeleteBcRecordByIds) // 批量删除bcRecord表
		bcRecordRouter.PUT("updateBcRecord", bcRecordApi.UpdateBcRecord)              // 更新bcRecord表
	}
	{
		bcRecordRouterWithoutRecord.GET("findBcRecord", bcRecordApi.FindBcRecord)       // 根据ID获取bcRecord表
		bcRecordRouterWithoutRecord.GET("getBcRecordList", bcRecordApi.GetBcRecordList) // 获取bcRecord表列表
	}
	global.GVA_Timer.AddTaskByFunc("func", "@daily", bcRecordApi.DeleteBcRecordByTime)
}
